import request from '@/utils/request'

// 接诊接口
export const AdmissionsApi = {
	/**
	 * @desc 诊中智能助手—-获取标签
	 * @param {bgType, idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getLabel(data) {
		return request({
			url: `/cd/clinic-in-helper/getLabel`,
			method: 'post',
			data
		})
	},
	/**
	 * @desc 诊中智能助手——接诊——关键指标趋势
	 * @param {bgType, idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getHelperChart(data) {
		return request({
			url: `/cd/clinic-in-helper/getHelperChart`,
			method: 'post',
			data
		})
	},
	/**
	 * @desc 诊中智能助手——接诊——获取诊前异常
	 * @param {bgType, idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getClinicSign(data) {
		return request({
			url: `/cd/clinic-in-helper/getClinicSign`,
			method: 'post',
			data
		})
	},

	/**
	 * @desc 诊中智能助手——接诊——诊间随访
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getFollowUp(data) {
		return request({
			url: `/cd/clinic-in-helper/getFollowUp`,
			method: 'post',
			data
		})
	},

	/**
	 * @desc 更新就诊记录主治医师信息
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	updateClinicVisitDoctor(data) {
		return request({
			url: `/cd/clinic-in-helper/updateClinicVisitDoctor`,
			method: 'post',
			data
		})
	},

	/**
	 * @desc 更新虚拟门诊号
	 * @param {loginName, idNumber, outpatientNo} data
	 * @returns
	 * @auth wyj
	 */
	updateOutpatientNo(data) {
		return request({
			url: `/cd/clinic-in-helper/updateOutpatientNo`,
			method: 'post',
			data
		})
	},

	/**
	 * @desc 获取健康服务
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getHealthService(data) {
		return request({
			url: `/cd/clinic-in-helper/getHealthService`,
			method: 'post',
			data
		})
	}
}

// 诊毕
export const InterrogationApi = {

	/**
	 * @desc 诊中智能助手——接诊——诊间随访
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getHelperIn(data) {
		return request({
			url: `/cd/clinic-in-helper/getHelperIn`,
			method: 'post',
			data
		})
	},
	/**
	 * @desc 诊中智能助手——接诊——诊间随访
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	submit(data) {
		return request({
			url: `/cd/clinic-in-helper/saveHelperIn`,
			method: 'post',
			transformRequest: function(data) {
        return JSON.stringify(data)
      },
      headers: {
        'Content-Type': 'application/json'
      },
			data
		})
	}
}

// 检验检查接口
export const InspectionCheckApi = {
	/**
	 * @desc 诊中智能助手——检查检验——末次检验检查异常
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getLastAbnormalCheck(data) {
		return request({
			url: `/cd/clinic-in-helper/getLastAbnormalCheck`,
			method: 'post',
			data
		})
	},
	/**
	 * @desc 诊中智能助手——检查检验——推荐检查项
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getUndoneCheckName(data) {
		return request({
			url: `/cd/clinic-in-helper/getUndoneCheckName`,
			method: 'post',
			data
		})
	}
}

// 诊间随访
export const ClinicFollowUpApi = {

}

// 健康处方
export const HealthyPrescriptionApi = {
	/**
	 * @desc 诊中智能助手——健康处方
	 * @returns
	 */
	getRecipe(data) {
		return request({
			url: `/cd/clinic-in-helper/getRecipe`,
			method: 'post',
			data
		})
	}
}

// 用药接口
export const MedicationApi = {
	/**
	 * @desc 预填入
	 * @param {idNumber} data
	 * @returns
	 * @auth zh zy
	 */
	guidePrefilled(params) {
		return request({
			url: `/pc/health-portrait/get-med-fill`,
			method: 'get',
			params
		})
	},
	/**
	 * @desc 用药指导获取用药方案
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getMedsPlan(data) {
		return request({
			url: `/pc/health-portrait/get-plans`,
			method: 'post',
			transformRequest: function(data) {
        return JSON.stringify(data)
      },
      headers: {
        'Content-Type': 'application/json'
      },
      timeout: 24000000,
			data
		})
	}
}

// 诊毕
export const AfterTheDiagnosisApi = {
	/**
	 * @desc 诊中智能助手——诊毕——管理级别
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getAppraiseAdvice(data) {
		return request({
			url: `/cd/clinic-in-helper/getAppraiseAdvice`,
			method: 'post',
			data
		})
	},
	/**
	 * @desc 诊中智能助手——诊毕——转诊指征
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getReferralList(data) {
		return request({
			url: `/cd/clinic-in-helper/getReferralList`,
			method: 'post',
			data
		})
	},

	/**
	 * @desc 诊中智能助手——诊毕——转诊指征
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getManagePath(data) {
		return request({
			url: `/cd/clinic-in-helper/getPath`,
			method: 'post',
			data
		})
	},
	/**
	 * @desc 通过门诊号获取管理路径
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getPathByOutpatientNo(data) {
		return request({
			url: `/cd/clinic-in-helper/getPathByOutpatientNo`,
			method: 'post',
			data
		})
	}
}
